package com.course.domain.vo;

import com.baomidou.mybatisplus.annotation.TableField;
import com.course.domain.pojo.UserInfo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.math.BigDecimal;
import java.util.List;

@Data
public class CourseDetailVo {

    @ApiModelProperty("课程ID")
    private Long id;

    @ApiModelProperty("课程名称")
    private String name;

    @ApiModelProperty("教师姓名")
    private String teacherName;

    @ApiModelProperty("教师年龄")
    private Integer teacherAge;

    @ApiModelProperty("教师学历")
    private String teacherDegree;

    @ApiModelProperty("教师头像")
    private String teacherCover;

    @ApiModelProperty("教师简介")
    private String teacherRemark;

    @ApiModelProperty("教师粉丝数量")
    private Long teacherFollowers;

    @ApiModelProperty("教师售出数量")
    private Long teacherSold;

    @ApiModelProperty("教师课程获赞数量")
    private Integer teacherLikes;

    @ApiModelProperty("课程大纲")
    private List<CourseOutlineVo> outlines;

    @ApiModelProperty("课程详情")
    private String detail;

    @ApiModelProperty("常见问题")
    private List<CourseQuesVo> questions;

    @ApiModelProperty("课程标签")
    private List<String> tags;

    @ApiModelProperty("下单人数")
    private Long orderNumber;

    @ApiModelProperty("是否收费 0 免费 1 付费")
    private Integer type;

    @ApiModelProperty("课程预览视频路径")
    private String video;

    @ApiModelProperty("课程原始价格")
    private BigDecimal oriPrice;

    @ApiModelProperty("促销折扣")
    private BigDecimal discount;

    @ApiModelProperty("课程当前价格")
    private BigDecimal curPrice;

    @ApiModelProperty("课程预览图片")
    private List<CoursePreviewImageVo> images;

    @ApiModelProperty("相关推荐")
    private List<CourseVo> relatedCourses;

    @ApiModelProperty("评论数")
    private Long commentNum;

    @ApiModelProperty("点赞数")
    private Long likesNum;


    public void setTeacher(UserInfo userInfo) {
        this.teacherName = userInfo.getName();
        this.teacherAge = userInfo.getAge();
        this.teacherDegree = userInfo.getDegree();
        this.teacherCover = userInfo.getImage();
        this.teacherRemark = userInfo.getRemark();
    }
}
